#!/usr/bin/env python
# -*- coding: utf-8 -*-
__author__ = 'tian'
__data__ = '2021/11/24 14:21'
# software: PyCharm

from django.template import Library
from django.urls import reverse

# https://feathericons.com/  feather图标官网,左侧导航栏中都使用了feather图标

register = Library()


@register.inclusion_tag('inclusion/left_menu_list.html')
def left_menu_list(request):
    data_list = [
        {"title": "项目管理", "url": reverse("index"), "span": "home"},
        {"title": "用例执行日志", "url": reverse("logs_list"), "span": "archive"},
        {"title": "用例数据统计", "url": reverse("show_tab"), "span": "bar-chart-2"},
        {"title": "wiki文档", "url": reverse("wiki"), "span": "folder-minus"},
        {"title": "文件管理", "url": reverse("file"), "span": "file-plus"},
        {"title": "域名管理", "url": reverse("domain"), "span": "link-2"},
        {"title": "APK下载", "url": reverse("apk_home"), "span": "chevrons-down"},
    ]
    for item in data_list:
        if request.path_info.startswith(item['url']):
            item['class'] = "active"
    return {"data_list": data_list}
